﻿using System.Data;
using System.Data.SqlClient;

namespace SummerSmile.Common.Utils.Data.DBFactory
{
    internal class SqlFactory : IDBFactory
    {
        public IDbConnection CreateConnection()
        {
            return new SqlConnection();
        }

        public IDbCommand CreateCommand()
        {
            return new SqlCommand();
        }

        public IDbDataAdapter CreateDataAdapter(IDbCommand cmd)
        {
            return new SqlDataAdapter((SqlCommand)cmd);
        }

        public string GetDateTimeString(string datetime)
        {
            return "'" + datetime + "'";
        }
    }
}
